package com.example.neteaseapplication.ui.home;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;

import com.example.neteaseapplication.LocalMusicActivity;
import com.example.neteaseapplication.MainActivity;
import com.example.neteaseapplication.R;
import com.example.neteaseapplication.inter.ILocalMusic;

public class HomeFragment extends Fragment implements View.OnClickListener{
    private ImageButton mIbLocalMusic;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fg_home, container, false);
        mIbLocalMusic = view.findViewById(R.id.ib_local_music);
        mIbLocalMusic.setOnClickListener(this);

        return view;
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
    }


    @Override
    public void onClick(View v) {
        MainActivity activity = (MainActivity) getActivity();
        activity.toLocalMusic();
//        startActivity(new Intent().setClass(getActivity(), LocalMusicActivity.class));

    }
}
